package com.dianzhihan.cashier.model.order;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Setter;
import lombok.ToString;

/**
 * @author Dianzhi Han
 * @version 1.0
 * @description: 专门给OrderDetail中的Item列表用的
 * @date 2023/2/12 17:41
 */

@Setter
@ToString
@EqualsAndHashCode
public class OrderItemDetail {
    private int productId;
    private String productName;
    private int productPrice;
    private int productNumber;
    private String productUnit;
    private int productDiscount;

    public OrderItemDetail(){};

    public int getId() {
        return productId;
    }

    public String getName() {
        return productName;
    }

    public double getPrice() {
        return productPrice / 100.0;
    }

    public int getNumber() {
        return productNumber;
    }

    public String getUnit() {
        return productUnit;
    }

    public double getPayable() {
        return getPrice() * productNumber;
    }

    public double getActual() {
        return getPayable() * productDiscount / 100.0;
    }
}
